/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CarddYcdd extends BasicModel<CarddYcdd> {
  ycddDdbh?: string; // 订单编号
  ycddDdzt?: string; // 订单状态
  ycddYwy?: string; // 业务员
  ycddYcdw?: string; // 用车单位
  ycddBm?: string; // 部门
  ycddLxr?: string; // 联系人
  ycddLxdh?: string; // 联系电话
  ycddScdd?: string; // 上车地点
  ycddXcdd?: string; // 下车地点
  ycddFkfs?: string; // 付款方式
  ycddRwbh?: string; // 任务编号
  ycddRwdj?: string; // 任务等级
  ycddYwlx?: string; // 业务类型
  ycddZdzk?: number; // 整单折扣(%)
  ycddYckssj?: string; // 用车开始时间
  ycddYcjssj?: string; // 用车结束时间
  ycddZcsz?: string; // 租车时长
  ycddDdyj?: number; // 订单押金
  ycddYsje?: number; // 预收金额
  ycddJsfs?: string; // 结算方式
  ycddZxmc?: string; // 专项名称
  ycddClyq?: string; // 车辆要求
  ycddClxc?: string; // 车辆行程
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
  carddYcddBtList?: any[]; // 子表列表
}

export const carddYcddList = (params?: CarddYcdd | any) =>
  defHttp.get<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/list', params });

export const carddYcddListData = (params?: CarddYcdd | any) =>
  defHttp.post<Page<CarddYcdd>>({ url: adminPath + '/cardd/order/carddYcdd/listData', params });

export const carddYcddForm = (params?: CarddYcdd | any) =>
  defHttp.get<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/form', params });

export const carddYcddSave = (params?: any, data?: CarddYcdd | any) =>
  defHttp.postJson<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/save', params, data });

export const carddYcddImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/order/carddYcdd/importData',
      onUploadProgress,
    },
    params,
  );

export const carddYcddDelete = (params?: CarddYcdd | any) =>
  defHttp.get<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/delete', params });

export const carddYcddCancel = (params?: CarddYcdd | any) =>
  defHttp.get<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/cancel', params });

export const carddYcddRecover = (params?: CarddYcdd | any) =>
  defHttp.get<CarddYcdd>({ url: adminPath + '/cardd/order/carddYcdd/recover', params });


export const carListByDay = (params?: CarddYcdd | any) =>
  defHttp.post<Page<CarddYcdd>>({ url: adminPath + '/cardd/order/carddYcdd/carListByDay', params });

export const personListByDay = (params?: CarddYcdd | any) =>
  defHttp.post<Page<CarddYcdd>>({ url: adminPath + '/cardd/order/carddYcdd/personListByDay', params });

export const carListByWeek = (params?: CarddYcdd | any) =>
  defHttp.post<Page<CarddYcdd>>({ url: adminPath + '/cardd/order/carddYcdd/carListByWeek', params });

export const personListByWeek = (params?: CarddYcdd | any) =>
  defHttp.post<Page<CarddYcdd>>({ url: adminPath + '/cardd/order/carddYcdd/personListByWeek', params });